package com.spc.demo;

import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        // 根节点
        TreeNode rootNode = new TreeNode(0, 0, "0");

        // 子节点
        List<TreeNode> treeNodeList = new ArrayList<>();
        treeNodeList.add(new TreeNode(1, 0, "1"));
        treeNodeList.add(new TreeNode(2, 0, "2"));
        treeNodeList.add(new TreeNode(3, 1, "3"));
        treeNodeList.add(new TreeNode(4, 2, "4"));
        treeNodeList.add(new TreeNode(5, 2, "5"));
        treeNodeList.add(new TreeNode(6, 3, "6"));

        // 构建client
        TreeClient treeClient = new TreeClient(rootNode, treeNodeList);
        TreeNode buildRootNode = treeClient.buildTree();

        System.out.printf(buildRootNode.toString());

    }
}
